// https://nuxt.com/docs/api/configuration/nuxt-config
import path from "path";
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
export default defineNuxtConfig({
  devtools: {
    enabled: true,

    timeline: {
      enabled: true,
    },
  },

  modules: [
    '@vueuse/nuxt',
    '@unocss/nuxt',
    '@pinia/nuxt',
    '@element-plus/nuxt',
    '@nuxtjs/color-mode',
    '@nuxt/image',
    '@pinia-plugin-persistedstate/nuxt',
  ],
  compatibilityDate: "2024-07-09",
  // vueuse
  vueuse: {
    ssrHandlers: true,
  },

  // colorMode
  colorMode: {
    classSuffix: '',
  },

  unocss: {
    uno: true,
    attributify: true,
    icons: {
      scale: 1.2,
    },
  },
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: `@use "@/assets/scss/element/index.scss" as element;`,
        },
      },
    },
    plugins: [
      createSvgIconsPlugin({
        iconDirs: [path.resolve(process.cwd(), "public/svg")],
      }),
    ],
  },
  // css
  css: ['~/assets/scss/reset.scss'],
  elementPlus: {
    icon: 'ElIcon',
    importStyle: 'scss',
  },
  hooks: {
    // 'pages:extend'(pages) {
    //   // add a route
    //   console.log({pages})
    // }
  },
  nitro: {
    // preset:'static'
  }
})